package org.example.dao.dto.post;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.dao.entity.post.PPost;
import org.example.partten.builder.product.post.PPostDto;

/**
 * @author 22449
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class EsPostDto {

    private String content;

    private Long themeId;
    private Integer hot;

    public EsPostDto(PPostDto postDto) {
        PPost post = postDto.getPPost();
        this.content = post.getContent();
        this.themeId = post.getThemeId();
        this.hot = (post.getLikeNum()+1) * (post.getClickNum()+1) + post.getBrowseNum();
    }
}
